package cn.afactory.tygz.common;

public class Gendar {
	/**
	 * The gender 
	 */
	public static final int MALE = 0x0;
	public static final int FEMALE = 0x1;
	public static final int OTHER = 0x2;
	
	public static final String GENDAR_MALE = "MALE";
	public static final String GENDAR_FEMALE = "FEMALE";
	public static final String GENDAR_INVALID_GENDAR = "INVALID_GENDER";
	
	public static final String LOCAL_GENDAR_MALE = "男";
	public static final String LOCAL_GENDAR_FEMALE = "女";
	public static final String LOCAL_GENDAR_INVALID_GENDAR = "未知";
	
	public static String getServerGendar(String local){
		if(local.equals(LOCAL_GENDAR_MALE)){
			return GENDAR_MALE;
		}else if(local.equals(LOCAL_GENDAR_FEMALE)){
			return GENDAR_FEMALE;
		}else if(local.equals(LOCAL_GENDAR_INVALID_GENDAR)){
			return GENDAR_INVALID_GENDAR;
		}
		return null;
	}
	
	public static String getLocalGendar(String server){
		if(GENDAR_MALE.equals(server)){
			return LOCAL_GENDAR_MALE;
		}else if(GENDAR_FEMALE.equals(server)){
			return LOCAL_GENDAR_FEMALE;
		}else if(GENDAR_INVALID_GENDAR.equals(server)){
			return LOCAL_GENDAR_INVALID_GENDAR;
		}
		return LOCAL_GENDAR_INVALID_GENDAR;
	}
}
